package com.shw.pclient.ui;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.shw.pclient.R;

/**
 * 
 * @author HAHA
 * 
 */
public class ShowImageActivity extends Activity {

	private TextView navBackView;
	private TextView navTitleView;
	private TextView navHomeView;
	private ImageView imageView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.show_image);
		navBackView = (TextView) findViewById(R.id.NavigateBack);
		navBackView.setOnClickListener(new NavBackViewClickListener());
		navTitleView = (TextView) findViewById(R.id.NavigateTitle);
		navTitleView.setText(R.string.shw_home);
		navHomeView = (TextView) findViewById(R.id.NavigateHome);
		navHomeView.setOnClickListener(new NavHomeViewClickListener());
		imageView = (ImageView) findViewById(R.id.shw_image_img);
		Bundle bundle=this.getIntent().getExtras();
		Bitmap b = BitmapFactory.decodeFile(bundle.getString("img_res"));
		imageView.setImageBitmap(b);
	}

	class NavBackViewClickListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			ShowImageActivity.this.setResult(RESULT_OK);
			ShowImageActivity.this.finish();
		}

	}

	class NavHomeViewClickListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			ShowImageActivity.this.finish();
		}

	}
}
